﻿using Demo.OrderManager.Orders;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Demo.OrderManager.EntityFrameworkCore;

[ConnectionStringName(OrderManagerDbProperties.ConnectionStringName)]
public class OrderManagerDbContext : AbpDbContext<OrderManagerDbContext>, IOrderManagerDbContext
{
    /* Add DbSet for each Aggregate Root here. Example:
     * public DbSet<Question> Questions { get; set; }
     */
    public DbSet<Order> Orders { get; set; }
        
    public OrderManagerDbContext(DbContextOptions<OrderManagerDbContext> options) 
        : base(options)
    {

    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.ConfigureOrderManager();
    }
}